package javaHomework;

public class User {
    private String account;
    private String password;
    private String email;
    public User(String account,String password,String email){
        this.account=account;
        this.password=password;
        this.email=email;
    }
    public User(String account,String password){
        this.account=account;
        this.password=password;
    }
    public void outInformation(){
        System.out.println("账号："+account);
        System.out.println("密码"+password);
        if(email != null){
            System.out.println("邮箱："+email);
        }
        else{
            System.out.println("邮箱：void");
        }

    }

    public static void main(String[] args) {
        User u1=new User("123","456","1.com");
        User u2=new User("456","45");
        u1.outInformation();
        u2.outInformation();
    }
}
